<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var num=10
    function f1(){
        var num=20
        function f2(){
            var num=30
            function f3(){
                var num=50
                console.log(num); //就近原则
            }
            f3()
        }
        f2()
    }
    f1()
</script>
</html>